/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author SOGOBA
 */
@Entity
@Table(name = "accounts", catalog = "ecom_db", schema = "")
@NamedQueries({
    @NamedQuery(name = "Accounts.findAll", query = "SELECT a FROM Accounts a"),
    @NamedQuery(name = "Accounts.findByIdAccount", query = "SELECT a FROM Accounts a WHERE a.idAccount = :idAccount"),
    @NamedQuery(name = "Accounts.findBySolde", query = "SELECT a FROM Accounts a WHERE a.solde = :solde")})
public class Accounts implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_account", nullable = false, length = 34)
    private String idAccount;
    @Column(name = "Solde", precision = 22)
    private Double solde;
    @OneToMany(mappedBy = "accounts")
    private List<Productsstore> productsstoreList;
    @OneToMany(mappedBy = "accounts")
    private List<Customers> customersList;

    public Accounts() {
    }

    public Accounts(String idAccount) {
        this.idAccount = idAccount;
    }

    public String getIdAccount() {
        return idAccount;
    }

    public void setIdAccount(String idAccount) {
        this.idAccount = idAccount;
    }

    public Double getSolde() {
        return solde;
    }

    public void setSolde(Double solde) {
        this.solde = solde;
    }

    public List<Productsstore> getProductsstoreList() {
        return productsstoreList;
    }

    public void setProductsstoreList(List<Productsstore> productsstoreList) {
        this.productsstoreList = productsstoreList;
    }

    public List<Customers> getCustomersList() {
        return customersList;
    }

    public void setCustomersList(List<Customers> customersList) {
        this.customersList = customersList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAccount != null ? idAccount.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Accounts)) {
            return false;
        }
        Accounts other = (Accounts) object;
        if ((this.idAccount == null && other.idAccount != null) || (this.idAccount != null && !this.idAccount.equals(other.idAccount))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Accounts[idAccount=" + idAccount + "]";
    }

}
